home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 701-725 / 716 / talincode / talincode.lha / paintrect.asm < prev    next >
Assembly Source File  |  1992-02-20  |  920b  |  38 lines

  1. * ============================================================================ *
  2. *    PaintRect: Safe RectFill with relative width and height
  3. *
  4. *    void PaintRect(struct RastPort *rp,SHORT x, SHORT y, SHORT w, SHORT h);
  5. *
  6. *    void PaintIBox(struct RastPort *rp, struct IBox *b);
  7. *                  a1                   a0
  8. * ============================================================================ *
  9.  
  10.             SECTION        paintrect.asm,CODE
  11.  
  12.             xdef        _PaintRect
  13.             xdef        _PaintIBox
  14.             xref        _GfxBase,_LVORectFill
  15.  
  16. _PaintRect
  17.             movem.l        d2/d3/a6,-(sp)
  18.             move.l        16(sp),a1
  19.             movem.w        20(sp),d0-d3
  20. pr:
  21.             subq.w        #1,d2
  22.             bmi.s        9$
  23.             subq.w        #1,d3
  24.             bmi.s        9$
  25.             add.w        d0,d2
  26.             add.w        d1,d3
  27.             move.l        _GfxBase,a6
  28.             jsr            _LVORectFill(a6)
  29. 9$            movem.l        (sp)+,d2/d3/a6
  30.             rts
  31.  
  32. _PaintIBox:
  33.             movem.l        d2/d3/a6,-(sp)            ; save same regs
  34.             movem.w        (a0),d0-d3                ; get regs from IBox
  35.             bra.s        pr                        ; and draw like usual
  36.  
  37.             end
  38.